package com.xiaoq.user;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xiaoq.schedule.user.IUserScheduleApi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by chenjh on 2018/3/28.
 */
@Component
public class UserTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserTask.class);

    @Reference(interfaceClass=IUserScheduleApi.class, check=false, version="1.0.0")
    private IUserScheduleApi userScheduleApi;


    /*每65秒执行一次*/
    @Scheduled(fixedRate = 65000)
    public void updateUserPhoneBelong(){
        try {
            userScheduleApi.updateUserPhoneBelongInfo();
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }


}
